//
//  FirstCollectionViewCell.m
//  dongdongbook
//
//  Created by yaotd-PC on 2017/12/20.
//  Copyright © 2017年 yaotengdong. All rights reserved.
//

#import "FirstCollectionViewCell.h"

@implementation FirstCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.myLabel = [[UILabel alloc] init];
        self.myLabel.backgroundColor = [UIColor cyanColor];
        [self.contentView addSubview:self.myLabel];
        
        self.myImageview = [[UIImageView alloc] init];
        self.myImageview.backgroundColor = [UIColor blueColor];
        [self.contentView addSubview:self.myImageview];
    }
    return self;
}
- (void)layoutSubviews
{
    [super layoutSubviews];
//    布局
    CGFloat width = self.contentView.frame.size.width;
    CGFloat height = self.contentView.frame.size.height;
    self.myImageview.frame = CGRectMake(0, 0, width, height * 4 / 5);
    self.myLabel.frame = CGRectMake(0, height * 4 / 5, width, height / 5);
}


@end
